40_MCU Programming & System Prototyping Continued

Before testing the PWM signal on the motors, I wanted to connect one of the encoders to the motor so we could try to track motor motion.  The encoder fits over the back of the motor as in Figure 1 and provides six connections (GND, OutA, OutB, Vcc, M1, & M2).  OutA and OutB are the two offset pulse signals sent out from the encoder, 12 pulses for every revolution.  Vcc and GND power the encoder, and M1/M2 are the motor terminals.
Figure 1:  Encoder Attached/Soldered Onto Back Shaft of Geared DC Motor

After soldering the encoder onto the back of the motor, I rebuilt the motor driver circuit (Inverters, AND’s, & H-Bridges - Figure 2) onto a more compact breadboard and plugged the MCU’s PWM signal into the driver circuit (PWM signal was previously plugged only into an LED).  The direction signal input for the driver circuit was connected to ground for now (would cause the motor to turn in one direction, 5V would turn it the other direction).  With the H-Bridges using a driving voltage rail of 5V, the PWM signal from the dsPIC30 was relayed to the motor and caused it to run at a variable speed depending on what duty cycle the signal was set to.  
Figure 2: Motor Driver Circuit (left) with dsPIC30 (right)

I tried monitoring the encoder output pulses with the ELVIS Board’s oscilloscope, but the received signal was too messy to interpret as digital pulses.  I thought the motor might be turning too fast for the Hall-Effect sensors in the encoder to recognize, but the wires used to connect to the oscilloscope were extremely long (2m), so I decided to program something later on the MCU that would indicate how many pulses were being received, since the signals were probably too low power to transmit over to the ELVIS Board at a high frequency.